package section3;

import section1.Lagrange_relaxation;

import java.awt.Color;
import java.awt.Graphics;
import java.io.File;
import javax.swing.JFrame;

public class draw extends JFrame {
    public draw()
    {
        setSize(150,50);
        setDefaultCloseOperation(EXIT_ON_CLOSE);
        setLocationRelativeTo(null);
    }
    public void paint(Graphics g)
    {
        File file = new File("88node.xls");
        double[] longitude = Lagrange_relaxation.readExcelInLA(file,0,2,7,false);
        double[] latitude = Lagrange_relaxation.readExcelInLA(file,0,2,7,false);

        g.setColor(Color.blue);
        for(int j=0;j<Greedy_add_heuristic.x.length;j++){
            if(Greedy_add_heuristic.x[j]==1){
                g.drawLine((int)longitude[j],(int)latitude[j],(int)longitude[j],(int)latitude[j]);
                for(int i=0;i<Greedy_add_heuristic.y.length;i++){
                    if(Greedy_add_heuristic.y[i][j]==1){
                        g.drawLine((int)longitude[j],(int)latitude[j],(int)longitude[i],(int)latitude[i]);
                    }
                }
            }
        }
    }
    public static void main(String[] args)
    {
        new draw().setVisible(true);
    }

}
